package univer.oko.utilities.calendar;

import java.io.Serializable;

/**
 * @author Eduard Dudar
 *         Date: 29.08.2005
 *         Time: 1:59:52
 */
public class Entry implements Serializable {
    private double payGrn = 0.0;
    private double chargeGrn = 0.0;
    private double payUsd = 0.0;
    private double chargeUsd = 0.0;

    public Entry() {

    }

    public void setPayment(double grn, double usd) {
        if (grn > 0) {
            this.payGrn += grn;
        } else {
            this.chargeGrn += grn;
        }

        if (usd > 0) {
            this.payUsd += usd;
        } else {
            this.chargeUsd += usd;
        }
    }

    public double[] getPayment() {
        double [] arr = new double[4];
        arr[0] = this.chargeGrn;
        arr[1] = this.payGrn;
        arr[2] = this.chargeUsd;
        arr[3] = this.payUsd;
        return arr;
    }

    public String toString() {
        return this.chargeGrn + ", " + this.payGrn + ", [" + this.chargeUsd + ", " + this.payUsd + "]";
    }
}
